import xlrd

data = xlrd.open_workbook('进出港航班量.xls')
table = data.sheet_by_name('Sheet1')

def getCell(x,y):
    return table.cell(x, y).value

time=0
x1=1
x2=2

names=[]
for i in range(1,25):
    names.append(getCell(i,time))

x = range(1,25)

y1=[]
for i in range(1,25):
    y1.append(float(getCell(i, x1)))
y2=[]
for i in range(1,25):
    y2.append(float(getCell(i, x2)))

import matplotlib.pyplot as plt
plt.rcParams['font.sans-serif'] = ['SimHei'] # 中文
import pltHelp

plt.plot(x, y1, mec='r', mfc='w',label=u'进港航班数量')
plt.plot(x, y2, ms=10,label=u'出港航班数量')
plt.legend()  # 让图例生效
pltHelp.show('时间','航班数')
